package com.nc.delivery_project.shared.locator;

import com.google.web.bindery.requestfactory.shared.Locator;
import com.nc.delivery_project.server.domain.OrderWaypoint;
import com.nc.delivery_project.server.service.OrderWaypointService;
import com.nc.delivery_project.shared.servicelocator.OrderWaypointServiceLocator;



public class OrderWaypointLocator extends Locator<OrderWaypoint, Integer> {

	@Override
	public OrderWaypoint create(Class<? extends OrderWaypoint> arg0) {
		return new OrderWaypoint();
	}

	@Override
	public OrderWaypoint find(Class<? extends OrderWaypoint> arg0, Integer id) {
		return ((OrderWaypointService) new OrderWaypointServiceLocator().getInstance(null)).read(id);
	}

	@Override
	public Class<OrderWaypoint> getDomainType() {
		return OrderWaypoint.class;
	}

	@Override
	public Integer getId(OrderWaypoint domainObject) {
		return domainObject.getId();
	}

	@Override
	public Class<Integer> getIdType() {
		return Integer.class;
	}

	@Override
	public Object getVersion(OrderWaypoint domainObject) {
        return domainObject.getId();
	}

}
